/**
 * 
 */
package com.freecsim.sas.core;

import com.freecsim.sas.core.exception.ServiceIDExistsException;
import com.freecsim.sas.core.exception.ServiceNotFoundException;
import com.freecsim.sas.core.exception.ServiceStartException;
import com.freecsim.sas.core.services.IService;

/**
 * 服务管理接口
 * @author georgewu
 *
 */
public interface ServiceManager {
	
	/**
	 * 注册服务
	 * @param service
	 */
	void registerService(IService service) throws ServiceIDExistsException;
	
	/**
	 * 启动所有服务
	 * @throws ServiceStartException 
	 */
	void startServices() throws ServiceStartException;
	
	/**
	 * 关闭所有服务
	 */
	void closeServices();
	
	/**
	 * 根据服务标识获得服务
	 * @param name
	 * @return
	 */
	IService getService(String name) throws ServiceNotFoundException;
}
